<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="@{include} :: header"></head>
<link href="css/bootstrap.min.css?v=3.3.6" th:href="@{/css/bootstrap.min.css?v=3.3.6}" rel="stylesheet">
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input id="id" name="id" th:value="${terminal.id}" type="hidden">
                        <input id="isClean" name="isClean" th:value="${terminal.isClean}" type="hidden">

                        <div class="form-group">
                            <label class="col-sm-3 control-label">所属企业：</label>
                            <div class="col-sm-8">
                                <select id="shopId" name="shopId" lay-search="" class="form-control chosen-select">
                                    <option value="">所属企业</option>
                                    <th:block th:each="d : ${shops}">
                                        <option th:value="${d.id}" th:text="${d.shopName}" th:selected="${terminal.shopId eq d.id}"></option>
                                    </th:block>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">设备名称：</label>
                            <div class="col-sm-8">
                                <input id="terminalName" name="terminalName" th:value="${terminal.terminalName}" class="form-control" type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">设备编号：</label>
                            <div class="col-sm-8">
                                <input id="terminalNum" name="terminalNum" th:value="${terminal.terminalNum}" class="form-control" type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">设备工段：</label>
                            <div class="col-sm-8">
                                <select data-placeholder="--请选择设备工段--" name="terminalType" id="terminalType" class="form-control chosen-select"
                                        th:value="${terminal.terminalType}"></select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">设备状态：</label>
                            <div class="col-sm-8">
                                <select data-placeholder="--请选择--" name="state" id="state" class="form-control chosen-select">
                                    <option value="1" th:selected="${terminal.state eq 1}">开启</option>
                                    <option value="0" th:selected="${terminal.state eq 0}">禁用</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">巡检周期：</label>
                            <div class="col-sm-8">
                                <div class="layui-inline">
                                    <div class="layui-input-inline" style="width: 150px;">
                                        <input type="number" id="checkCount" name="checkCount" th:value="${terminal.checkCount}" placeholder="周期次数" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-input-inline" style="width: 150px;">
                                        <select data-placeholder="周期单位" name="checkCountUnit" id="checkCountUnit" class="form-control chosen-select"
                                                th:value="${terminal.checkCountUnit}"></select>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">清洁周期：</label>
                            <div class="col-sm-8">
                                <div class="layui-inline">
                                    <div class="layui-input-inline" style="width: 150px;">
                                        <input type="number" id="cleanCount" name="cleanCount"  th:value="${terminal.cleanCount}" placeholder="周期次数" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-input-inline" style="width: 150px;">
                                        <select data-placeholder="周期单位" name="cleanCountUnit" id="cleanCountUnit" class="form-control chosen-select"
                                                th:value="${terminal.cleanCountUnit}"></select>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">是否显示巡查点：</label>
                            <div class="col-sm-8">
                                <select data-placeholder="--请选择--" name="isShowCheckPoint" id="isShowCheckPoint"
                                        class="form-control chosen-select" onchange="showCheckPoint()">
                                    <option value="1" th:selected="${terminal.isShowCheckPoint eq 1}">显示</option>
                                    <option value="0" th:selected="${terminal.isShowCheckPoint eq 0}">不显示</option>
                                </select>
                            </div>
                        </div>

                        <div id="divCheckPoints" class="form-group" th:classappend="${(terminal.isShowCheckPoint == 1 || terminal.id == 0 || terminal.id == null) ? '':'hidden' }">
                            <label class="col-sm-3 control-label">巡查点：</label>
                            <div class="col-sm-8">
                                <textarea id="checkPoints" name="checkPoints" th:text="${terminal.checkPoints}" class="form-control" rows="4" style="display: none;"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/appjs/module/terminal/detail.js}"></script>
</body>
</html>
